package com.seafood.dto;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;

/**
 * 订单DTO
 */
@Data
public class OrderDTO {
    
    private Long id;
    
    private Long userId;
    
    private String userName;
    
    private String orderNumber;
    
    @NotNull(message = "总金额不能为空")
    @DecimalMin(value = "0.0", message = "总金额不能小于0")
    private BigDecimal totalAmount;
    
    private BigDecimal shippingFee;
    
    private BigDecimal discountAmount;
    
    @NotNull(message = "实付金额不能为空")
    @DecimalMin(value = "0.0", message = "实付金额不能小于0")
    private BigDecimal finalAmount;
    
    private String status;
    
    private String paymentMethod;
    
    private String paymentTime;
    
    @NotBlank(message = "收货地址不能为空")
    private String shippingAddress;
    
    @NotBlank(message = "收货人姓名不能为空")
    @Size(max = 100, message = "收货人姓名长度不能超过100字符")
    private String recipientName;
    
    @NotBlank(message = "收货人电话不能为空")
    @Size(max = 20, message = "收货人电话长度不能超过20字符")
    private String recipientPhone;
    
    private String logisticsCompany;
    
    private String trackingNumber;
    
    private String remark;
    
    private String createdAt;
    
    private String updatedAt;
    
    // 订单详情列表
    private List<OrderItemDTO> orderItems;
}